<%-- 
    Document   : report
    Created on : Nov 15, 2011, 3:19:54 PM
    Author     : Yudi Retanto
--%>

<%@page import="java.util.Calendar"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<jsp:include page="/header.jsp"></jsp:include>
<link rel="stylesheet" href="assets/css/jquery.jqplot.min.css" type="text/css" />
<script type="text/javascript" src="assets/js/jquery.jqplot.min.js"></script>
<script type="text/javascript" src="assets/js/jqplot.dateAxisRenderer.min.js"></script>
<h1>
    Report Layanan Flight Tahun ${year}
</h1>
<div>
    <a href="javascript:window.print()">
        <button>Print</button>
    </a>
</div>
<div id="chartdiv" style="height:400px;width:800px; "></div>
<script>
    var line1=[<c:forEach items="${count}" var="c"><c:set var="ordinal" value="${ordinal + 1}" />['2011-${ordinal}-1',${c}],</c:forEach>];
  var plot2 = $.jqplot('chartdiv', [line1], {
      title:'Statistik penggunaan Layanan Flight Tahun ${year}',
      gridPadding:{right:35},
      axes:{
        xaxis:{
          renderer:$.jqplot.DateAxisRenderer,
          tickOptions:{formatString:'%b'},
          min:'Dec 1, ${year-1}',
          max:'Jan 1,${year+1}',
          tickInterval:'1 month',
          label:'Bulan'
        },
        yaxis:{
            label:'Pengguna',
            min:'0',
            tickInterval:'1'
        }
      },
      series:[{lineWidth:4, markerOptions:{style:'square'}}]
  });
</script>
<div>
    <form action="flights?action=report" method="post">
        <p> Go To : 
        <select name="year">
            <% 
            Calendar cal = Calendar.getInstance();
            cal.add(Calendar.YEAR, -9);
            for(int i=0;i<10;i++){
            %>
            <option value="<% out.print(cal.get(Calendar.YEAR));%>"><% out.print(cal.get(Calendar.YEAR));cal.add(Calendar.YEAR, 1);%></option>
            <% } %>
        </select>
        <input type="submit" value="Go"/>
        </p>
    </form>
</div>
<jsp:include page="/footer.jsp"></jsp:include>
